var pkid;

$(function() {
			$("#Button2").bind("click", function() {
				document.location = context + "/site/focalCompany/8.jsp";
					});

			var id = getParameter("9.js", "id");
			pkid = getParameter("9.js", "pkid");
			if (id != null && id != "") {
				edit(id);
			} else {
				neu();
			}

			$("#pageloading").hide();
		});

function edit(id) {
	var jsonparams = {
		id : id,
		primaryTable : "fcindent",
		foreignTables : [{
					foreignTable : "fcindentlist",
					listid : "fcorderlist"
				}]
	}

	var view = new $.grooveViewPreII(jsonparams, "addfcorder", {
				submitMessage : "确定提交更新订单信息",
				OKMessage : "成功更新订单信息",
				submitButtonID : "Button1",
				formID : "formID",
				beforecall : function() {

				},
				aftercall : function() {
					document.location = context + '/site/focalCompany/8.jsp';
				}
			});
}

function neu() {
	var view = new $.grooveView("addfcorder", {
				submitMessage : "确定保存订单信息",
				OKMessage : "成功保存订单信息",
				submitButtonID : "Button1",
				formID : "formID",
				mode : "insert",
				aftercall : function() {
					document.location = context + '/site/focalCompany/8.jsp';
				}
			});
}